﻿<%@ Page Title="网摘内容管理" Language="C#" MasterPageFile="~/mContentContainer.Master" AutoEventWireup="true" CodeBehind="MarkList.aspx.cs" Inherits="Rmlife.Web.MarkList" %>

<%@ Register Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" TagPrefix="pp1" %>
<%@ Register Namespace="Rmlife.Control" Assembly="Rmlife.Control" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">

        function addoreditMenu(mode, markID, title, emarkUrl, eauthor) {
            // alert($("opt").style);
            if ("edit" == mode) {
                $("opt").innerHTML = "摘要地址修改";
                $("opt").style.background = " url(../images/icons/icon55.jpg) no-repeat 6px 50%;";
            }
            $("mode").value = mode;
            $("markID").value = markID;
            $("<%=etitle.ClientID %>").value = title.toString();
            $("<%=emarkUrl.ClientID %>").value = emarkUrl.toString();
            $("<%=eauthor.ClientID %>").value = eauthor.toString();
            BOX_show('neworeditmainmenu');
        }

        function chkSubmit() {
            if ($("<%=etitle.ClientID %>").value == "") {
                alert("处理不能为空！");
                return false;
            }
            $("aspnetForm").submit();
            return true;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlace" runat="server">
    <asp:Panel runat="server" ID="panel">
        <div class="searchbox">
            <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
                <tr>
                    <th colspan="99" align="left">
                        &nbsp;&nbsp;&nbsp;
                    </th>
                    <br />
                </tr>
                <tr>
                    <td width="15%" align="right">
                        标题名称:
                    </td>
                    <td width="35%">
                        <cc1:TextBox ID="txtTitle" runat="server" Size="18">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr>
                    <td width="15%" align="right">
                        作者:
                    </td>
                    <td width="35%">
                        <cc1:TextBox ID="txtAuthor" runat="server" Size="18">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr>
                    <td width="15%" align="right">
                        创建时间范围:
                    </td>
                    <td colspan="3">
                        <cc1:TextBox ID="txtStartDate" Text="" runat="server" RequiredFieldType="日期" Width="70px">
                        </cc1:TextBox>
                        <asp:ImageButton ID="btnStartDate" runat="server" ImageUrl="../images/btn_calendar.gif" />
                        <ajaxToolkit:CalendarExtender ID="caBirthday" runat="server" TargetControlID="txtStartDate"
                            PopupButtonID="btnStartDate" Format="yyyy-MM-dd">
                        </ajaxToolkit:CalendarExtender>
                        至
                        <cc1:TextBox ID="txtEndDate" Text="" runat="server" RequiredFieldType="日期" Width="70px">
                        </cc1:TextBox>
                        <asp:ImageButton ID="btnEndDate" runat="server" ImageUrl="../images/btn_calendar.gif" />
                        <ajaxToolkit:CalendarExtender ID="caBirthday1" runat="server" TargetControlID="txtEndDate"
                            PopupButtonID="btnEndDate" Format="yyyy-MM-dd">
                        </ajaxToolkit:CalendarExtender>
                    </td>
                </tr>
            </table>
        </div>
        <div style="text-align: right; margin-right: 10px;">
            <cc1:Button ID="BtnSearch" runat="server" Text="开始搜索" OnClick="BtnSearch_Click" ButtonImgUrl="../images/search.gif" />
        </div>
        <div>
            <cc1:DataGrid ID="DataGrid1" runat="server" AllowCustomPaging="True" PageSize="4"
                TableHeaderName="网摘信息列表" AllowPaging="false" DataKeyField="BookmarkID" OnItemCommand="DataGrid1_ItemCommand">
                <columns>
                    <asp:BoundColumn DataField="Title" HeaderText="网摘标题" HeaderStyle-HorizontalAlign="Left"
                        HeaderStyle-Width="120px" SortExpression="Title">
                        <ItemStyle HorizontalAlign="Left" Width="120px" />
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="Author" SortExpression="Author" HeaderText="作者" HeaderStyle-HorizontalAlign="Left"
                        HeaderStyle-Width="120px">
                        <ItemStyle HorizontalAlign="Left" Width="120px" />
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="BookmarkUrl" SortExpression="BookmarkUrl" HeaderText="摘要地址"
                        HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="120px">
                        <ItemStyle HorizontalAlign="Left" Width="120px" />
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="DateCreated" SortExpression="DateCreated" HeaderText="摘要时间"
                        FooterStyle-HorizontalAlign="Left">
                        <ItemStyle HorizontalAlign="Left" Width="120px" />
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="操作" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="120px">
                        <ItemTemplate>
                            <input type="hidden" runat="server" value='<%#Eval("BookmarkID") %>' id="hidID" />
                            <a href="javascript:" onclick="addoreditMenu('edit','<%#Eval("BookmarkID") %>','<%#Eval("Title") %>','<%#Eval("BookmarkUrl") %>','<%#Eval("Author") %>')">
                                编辑</a> ||
                            <asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="deleteRecord"
                                OnClientClick="if(confirm('确定撤销该记录?')){return true;}return false;">删除</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                </columns>
                <pagerstyle mode="NumericPages"></pagerstyle>
                <selecteditemstyle cssclass="datagridSelectedItem"></selecteditemstyle>
                <headerstyle cssclass="category"></headerstyle>
            </cc1:DataGrid>
            <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
                <tr>
                    <td height="30" align="left" width="30%">
                        <pp1:AspNetPager ID="page1" runat="server" SubmitButtonText="GO" PageSize="10" PrevPageText="[前页]"
                            NextPageText="[后页]" LastPageText="[尾页]" FirstPageText="[首页]" LayoutType="Table"
                            AlwaysShow="True" OnPageChanged="page1_PageChanged" CssClass="pagetool" ShowCustomInfoSection="Right"
                            CurrentPageButtonPosition="Center" ShowPageIndexBox="Always">
                        </pp1:AspNetPager>
                    </td>
                    <td align="right">
                        &nbsp;
                        <asp:LinkButton runat="server" ID="BtnExport" OnClick="BtnExport_Click" Text="导 出"
                            CssClass="export" Visible="false"></asp:LinkButton>
                    </td>
                </tr>
            </table>
        </div>
        <div style="width: 100%; text-align: center">
            <cc1:Button ID="BtnAdd" runat="server" Text="新增" ButtonImgUrl="../Images/add.gif"
                AutoPostBack="false" OnClientClick="addoreditMenu('add','','','','')" /></div>
        <div id="BOX_overlay" style="background: #000; position: absolute; z-index: 100;
            filter: alpha(opacity=50); -moz-opacity: 0.6; opacity: 0.6;">
        </div>
        <div id="neworeditmainmenu" style="display: none; background: #fff; padding: 10px;
            border: 1px solid #999; width: 400px;">
            <div class="ManagerForm">
                <fieldset>
                    <legend id="opt" style="background: url(../images/icons/icon53.jpg) no-repeat 6px 50%;">
                        摘要新增</legend>
                    <table cellspacing="4" cellpadding="4" class="tabledatagrid" width="80%">
                        <tr>
                            <td>
                                标题:
                                <input type="hidden" id="markID" name="markID" value="0" />
                                <input type="hidden" id="mode" name="mode" value="" />
                            </td>
                            <td>
                                <cc1:TextBox ID="etitle" runat="server" MaxLength="50" Size="30">
                                </cc1:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                地址:
                            </td>
                            <td>
                                <cc1:TextBox ID="emarkUrl" runat="server" MaxLength="50" Size="30">
                                </cc1:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                作者:
                            </td>
                            <td>
                                <cc1:TextBox ID="eauthor" runat="server" MaxLength="50" Size="30">
                                </cc1:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <button type="button" class="ManagerButton" id="AddNewRec" onclick="chkSubmit();">
                                    <img src="../images/add.gif" />
                                    提 交
                                </button>
                                &nbsp;&nbsp;
                                <button type="button" class="ManagerButton" id="Button1" onclick="BOX_remove('neworeditmainmenu');">
                                    <img src="../images/state1.gif" />
                                    取 消
                                </button>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>
        </div>
        <div id="setting">
        </div>
    </asp:Panel>
    <asp:Label ID="msg" runat="server" CssClass="msg"></asp:Label>
</asp:Content>
